﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 抽象工厂模式.Sangguosha.Interface;
using 抽象工厂模式.Sangguosha.Service;

namespace 抽象工厂模式
{
    /// <summary>
    /// 简单工厂-工厂方法模式-抽象工厂模式
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //IGroup group = new GroupShu();
            //IGenerals generals = new GeneralsShu();
            //group.ShowGroup();
            //generals.ShowGenerals();
            {

                FactoryShu factoryShu = new FactoryShu();
                IGroup group = factoryShu.CreateGroup();
                IGenerals generals = factoryShu.CreateGenerals();
                group.ShowGroup();
                generals.ShowGenerals();
            }
            {

                FactoryWu factory = new FactoryWu();
                IGroup group = factory.CreateGroup();
                IGenerals generals = factory.CreateGenerals();
                group.ShowGroup();
                generals.ShowGenerals();
            }
            {

                FactoryWei factory = new FactoryWei();
                IGroup group = factory.CreateGroup();
                IGenerals generals = factory.CreateGenerals();
                group.ShowGroup();
                generals.ShowGenerals();
            }

            {

                AbstractFactory factory = new FactoryWei();
                IGroup group = factory.CreateGroup();
                IGenerals generals = factory.CreateGenerals();
                group.ShowGroup();
                generals.ShowGenerals();
            }
            Console.Read();
        }
    }
}
